package com.alienlab.schedule;

import java.util.Date;

import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
public class ScheduleJob implements Job{
	private static  Logger logger = Logger.getLogger("定时器调度");
	public void execute(JobExecutionContext context)throws JobExecutionException {
		logger.info("<<<<<<<<<<<<<<任务执行<<<<<<<<<<<<<<<<");
		Date dt=context.getFireTime();
		Date dtNext=context.getNextFireTime();
		String jobName=context.getJobDetail().getFullName();
		logger.info("任务名称:"+jobName);
		logger.info("任务触发时间:"+dt.toString());
		if(dtNext!=null)
			logger.info("任务下一次执行时间:"+dtNext.toString());
		
		String group=context.getJobDetail().getGroup();
		//此处根据组别调用执行方法。
		logger.info("<<<<<<<<<<<<<任务结束<<<<<<<<<<<<<<<<<");
	}
}
